<?php

require_once 'Logger.php';
require_once 'RedisManager.php';
require_once 'Config.php';
require_once 'PropSystem.php';

$playerId = 'player_1';
$propSystem = new PropSystem();
$redisManager = new RedisManager();


// 购买道具
try {
    $propSystem->buyAllProps($playerId);
    $inventory = $redisManager->getGameData($playerId, 'inventory') ?? [];
    echo "购买道具成功！剩余道具数量: " . json_encode($inventory, JSON_UNESCAPED_UNICODE) . "\n";
} catch (Exception $e) {
    echo "购买道具失败: " . $e->getMessage() . "\n";
}
